﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class goto语句使用 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {




    }



    protected void Button1_Click(object sender, EventArgs e)
    {
        int xp = 0;
        string[] mystr = new string[6];
        string inputStr = tt.Text;
        mystr[0] = "由于历史和现实的原因不会辩护";
        mystr[1] = "我们已经不肯认错";
        mystr[2] = "不敢认错";
        mystr[3] = "甚至不会认错";
        mystr[4] = "，当然也不会质疑不会批评，";
        mystr[5] = "不会道歉";
        for (int i = 0; i < mystr.Length; i++)
        {
            //通过if语句判断是否存在输入的字符串
            if (mystr[i].Equals(inputStr))
            {
                goto Found;
            }
        }
        Response.Write(string.Format("你查找的{0}不存在<br/>", inputStr));
        goto Finish;

    Found:
        Response.Write(string.Format("您查找的{0}存在！<br/>", inputStr));
        xp = 12134;
    Finish:
        Response.Write("查找完毕！<br/>" + xp);
     Labela:
    Response.Write("gotu输出！<br/>" );
    }
}